package com.naizhuai.ui.entity.User;

import com.contrarywind.interfaces.IPickerViewData;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;

/**
 * @author：lichenxi
 * @date 2018/5/15 17
 * email：525603977@qq.com
 * Fighting
 */
public class UserRank implements Serializable {

    /**
     * categoryList : [{"key":"1","label":"活力值"},{"key":"2","label":"行动力"},{"key":"3","label":"组织力"},{"key":"4","label":"团队性"},{"key":"5","label":"模拟效果"},{"key":"6","label":"助力榜"},{"key":"7","label":"影响力"}]
     * selectedLabel : {"key":"1","value":"行动力"}
     * rankData : [{"username":"成二","departmentName":"财务部","totalCount":"10","rank":"1"},{"username":"张三","departmentName":"活动部","totalCount":"20","rank":"2"},{"username":"李四","departmentName":"生活部","totalCount":"30","rank":"3"},{"username":"王五","departmentName":"信息部","totalCount":"40","rank":"4"},{"username":"刘六","departmentName":"调研部","totalCount":"50","rank":"5"},{"username":"梁七","departmentName":"生存部","totalCount":"60","rank":"6"},{"username":"华八","departmentName":"慢走部","totalCount":"70","rank":"7"},{"username":"陈十","departmentName":"花生部","totalCount":"80","rank":"8"},{"username":"芳华","departmentName":"牛奶部","totalCount":"90","rank":"9"}]
     * selfRankData : {"username":"李四","departmentName":"生活部","totalCount":"30","rank":"3"}
     */
    @SerializedName("selectedLabel")
    public LabelBean OptionLabel;
    @SerializedName("selectedDateLabel")
    public LabelBean YearLabel;
    public List<LabelBean> categoryList;
    public RankData selfRankData;
    public List<RankData> rankData;
    public List<LabelBean> dateSelect;

    public static class LabelBean implements IPickerViewData {
        /**
         * key : 1
         * value : 行动力／活力值／2018.夏季
         */
        public String key;
        public String label;
        private boolean selected = false;

        public boolean isSelected() {
            return selected;
        }
        public boolean setSelected(boolean selected) {
            if (this.selected == selected)
                return false;
            this.selected = selected;
            return true;
        }

        public boolean toggleSelected() {
            selected = !selected;
            return selected;
        }

        @Override
        public String getPickerViewText() {
            return label;
        }
    }

}
